﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.Master" AutoEventWireup="true"
    Inherits="Wjtour.Web.Admin.article.list" %>

<%@ Import Namespace="Wjtour.Domain" %>
<%@ Import Namespace="Wjtour.Common" %>
<%@ Import Namespace="Wjtour.Domain.dto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
    <script type="text/javascript">
        function getIds() {
            if ($('#cidselect').val() == 0) {
                alert('没有选择栏目');
                return false;
            }
            var ids = '';
            $('input[name=ids]').each(function () {
                if ($(this).attr('checked') == true) {
                    ids = ids + $(this).attr('id') + ',';
                }
            });
            if (ids == '') {
                alert('没有选择文章');
                return false;
            }
            $('#ids').val(ids);
        }
    </script>
    <table cellspacing="0" width="100%" style="border: 1px  solid #DCEAF7; border-bottom: 0px; background: #E9F2FB;">
        <tr>
            <td width="150px">&nbsp;<img src="../images/arrow.gif" width="16" height="22" align="absmiddle" />&nbsp;<a
                href="/admin/article/addedi.aspx?type=<%=type %>" class="link3">[新增文章]</a>
            </td>
            <td width="" align="right">标题：<asp:TextBox ID="q" runat="server" />&nbsp;<asp:DropDownList ID="cid" runat="server">
                <asp:ListItem Value="0">--顶层栏目--</asp:ListItem>
            </asp:DropDownList>&nbsp;<asp:Button ID="submit" runat="server" Text="提交" />
            </td>
            <td width="150px" align="right">共有 <b>
                <%=data.Pager.TotalRecords%></b> 条记录&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table id="listtable" border="1" cellpadding="0" cellspacing="0" bordercolor="#dddddd">
        <tr>
            <th width="3%">
                <input type="checkbox" onclick="checkAll(this, 'ids')" />
            </th>
            <th width="">标题
            </th>
            <th width="6%">缩略图
            </th>
            <th width="115px">栏目
            </th>
            <th width="10%">来源
            </th>
            <th width="5%">点击
            </th>
            <%if (type == "6")
              { %>
            <th width="5%">赞
            </th>
            <th width="10%">审核
            </th>
            <%} %>
            <th width="5%">排序
            </th>
            <th width="8%">操作
            </th>
        </tr>
        <%foreach (Wjtour.Domain.dto.article_articletype item in data.Datas)
          {
        %>
        <tr>
            <td>
                <input type='checkbox' name='ids' value='<%=item.id %>' id='<%=item.id %>' />
            </td>
            <td style="text-align: left; padding-left: 5px">
                <a href="/admin/article/addedi.aspx?type=<%=type %>&id=<%=item.id %>">
                    <%=item.title %>
            </td>
            <td pic="">
                <%=item.img %>
            </td>
            <td>
                <%=item.articletype %>
            </td>
            <td>
                <%=item.source %>
            </td>
            <td>
                <%=item.hits %>
            </td>
            <%if (type == "6")
              {
                  string audit = "";
                  switch (item.isaudit)
                  {
                      case 0:
                          audit = "<span style='color:red;font-weight:bold'>审核未通过</span>";
                          break;
                      case 1:
                          audit = "<span style='color:#ff6a00'>等待审核</span>";
                          break;
                      case 2:
                          audit = "<span style='color:green;font-weight:bold'>审核通过</span>";
                          break;
                      default:
                          break;
                  }
            %>
            <td>
                <%=item.zan %>
            </td>
            <td>
                <%=audit %>
            </td>
            <%} %>
            <td>
                <%=item.sort %>
            </td>
            <td>
                <a href="/admin/article/addedi.aspx?type=<%=type %>&id=<%=item.id %>">修改</a>
            </td>
        </tr>
        <%
          } %>
    </table>
    <div style="position: relative; padding-bottom: 10px">
        <input type="hidden" id="delRef" value="<%=delIds.ClientID %>" />
        <input type="hidden" id="auditText" value="<%=auditStatus.ClientID %>" />
        <asp:HiddenField ID="delIds" runat="server" />
        <div style="position: absolute; left: 5px; top: 5px">
            <asp:Button ID="delButton" runat="server" Text="删除" OnClientClick="return delConfirm()" />
            <%if (type == "6")
              {%>
            <asp:Button ID="auditButton" runat="server" Text="审核" OnClientClick="return auditConfirm()" />
            <asp:DropDownList ID="auditStatus" runat="server">
                <asp:ListItem Text="审核未通过" Value="0" />
                <asp:ListItem Text="等待审核" Value="1" />
                <asp:ListItem Text="审核通过" Value="2" />
            </asp:DropDownList>
            <%} %>
        </div>
        <div class="megas512" style="margin-top: 15px;">
            <%=PagerHtml%>
        </div>
    </div>
    <%--<div style="padding-left: 10px">
        批量移动：<select id="cidselect" name="cid" style="font-size: 12px"><option value="0">--顶层栏目--</option>
            <option value="1">站点帮助</option>
            <option value="3">&nbsp;┝ 返利常见问题</option>
            <option value="4">&nbsp;┝ 返利订单问题</option>
            <option value="5">&nbsp;┝ 返利提现问题</option>
            <option value="6">&nbsp;┝ 用户常见问题</option>
            <option value="2">网站公告</option>
            <option value="26">&nbsp;┝ 会员中心公告</option>
            <option value="27">&nbsp;┝ 网站前台公告</option>
            <option value="28">关于我们</option>
        </select>
        <input type="hidden" name="ids" id="ids" value="" /><input name="sub" type="submit"
            value="提交" />
    </div>--%>
</asp:Content>
